<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" href="../style/journal.css" type="text/css" />
<style type="text/css"><!--
.googleadsense {
	margin: 2px;
	padding: 0px;
//--></style><script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-65008-1";
urchinTracker();
</script><title>PerlTidy</title>
</head>
<body>
<a href="index.html">Journal</a>(2005) | <a href="../blog/"><b>Blog</b></a>(2006) | <a href="http://www.fayland.org/cgi-bin/random_link.pl">RandomLink</a> | <a href="AboutFayland.html">WhoAmI</a> | <a href="LiveBookmark.html">LiveBookmark</a> | <a href="http://www.fayland.org/">HomePage</a>
<p><&lt;Previous: <a href="mp3_ID3v1Tag.html">如何设置mp3文件的ID3v1Tag</a>&nbsp;&nbsp;>>Next: <a href="Module.html">Module</a></p>
<h1>PerlTidy</h1>
<div class='content'>
<p>Category: <a href='InstallNote.html'>InstallNote</a> &nbsp; Keywords: <b>PerlTidy</b></p>Perltidy is a tool to indent and reformat perl scripts. It can also write scripts in html format.<br>
Homepage:<a href="http://perltidy.sourceforge.net" target="_blank">http://perltidy.sourceforge.net</a>
<h2>Install</h2>
download PerlTidy-<font class="digit">20031021</font>, 
<pre>
perl Makefile.PL
(n)make test
(n)make install
</pre>
如果(n)make不成功的话，可以如下：
<ul>
<li>将lib目录中的Perl/Tidy.pm copy to $Perl/site/lib, 将bin目录下的perltidy copy to $Perl/lib. run
<pre>
$Perl\bin>perl perltidy testfile.pl
</pre></li>
<li>查看 pm2pl 文件，发现此程序将Tidy.pm与perltidy合并为一个新的 perltidy - Perl 文件
<pre>
>perl pm2pl testfile.pl
</pre>
</ul>
down来的包里有个目录为examples, 里面有些Script是值得一看的。
<h2>Usage</h2>
<pre>
perltidy -html testfile.pl
</pre>
此命令可生成已着色的HTML文件。<br>
虽然颜色可能不是很让人满意，但可以改其中的CSS style或通过增加-css=mystyle.css选项来添加自己的css.<br>
还有很多不错的选项如-nnn, 查阅perldoc <a href="http://search.cpan.org/perldoc?Perl::Tidy">Perl::Tidy</a>获得更多帮助。</div>
<p><&lt;Previous: <a href="mp3_ID3v1Tag.html">如何设置mp3文件的ID3v1Tag</a>&nbsp;&nbsp;>>Next: <a href="Module.html">Module</a></p>
<p><strong>Options:</strong> <a href='http://del.icio.us/post?title=PerlTidy&url=http://www.fayland.org/journal/PerlTidy.html'>+Del.icio.us</a></p>
<strong>Related items</strong>
<ul><li><a href='wwwsf4.cn.html'>WWW Security FAQ: CGI Scripts</a> < <span class='digit'>2004-11-10 22:30:44</span> ></li><li><a href='GoogleGroup.html'>WWW::Mechanize && Google Group</a> < <span class='digit'>2005-04-13 18:49:43</span> ></li></ul>
Created on <span class="digit">2004-10-30 19:23:26</span>, Last modified on <span class="digit">2004-11-20 13:42:00</span><br />
Copyright 2004-2005 All Rights Reserved. Powered by <a href="Eplanet.html">Eplanet</a> && <a href='http://catalyst.perl.org'>Catalyst</a> 5.62.
</body>
</html>